<div class="modal modal-" id="briefevaluateModal" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document" style="width:75%">
        <section class="invoice">
            <!-- title row -->
            <div class="row">
                <div class="col-xs-12">
                    <h2 class="page-header" style="text-align: center">
                        <button type="button" class="btn btn-danger pull-right btn-sm " data-dismiss="modal">关闭</button>
                        <i class="fa fa-globe"></i> <span id="briefevaluateModal_custName"></span>
                    </h2>

                </div>
                <!-- /.col -->
            </div>
            <!-- info row -->
            <div class="row invoice-info">
                <input type="hidden" id="briefevaluateModal_custId">
                <input type="hidden" id="briefevaluateModal_issuerId">
                <input type="hidden" id="briefevaluateModal_industry">
                <div class="col-sm-7 invoice-col">
                    <strong>企业评分：</strong><span id="briefevaluateModal_newScore"></span><br>
                    <strong>财报时间：</strong><span id="briefevaluateModal_newFinancialTime"></span><br>
                    <br><br>
                    <strong>历史评分情况：</strong>
                    <table id="table1" data-toggle="table"
                           data-url="#" data-search="false" data-pagination="false"  >
                        <thead>
                        <tr>
                            <th data-field="dataDate" data-sortable="true" data-formatter="financialTimeFormatter">历史财报时间</th>
                            <th data-field="score" data-sortable="true" data-formatter="table1ScoreFormatter">评分</th>
                        </tr>
                        </thead>
                    </table>
                    <br>
                    <strong>第一大股东：</strong><span id="briefevaluateModal_largestHolderName"></span>
                    <br>
                    <strong>持股比例：</strong><span id="briefevaluateModal_largestHold"></span>
                    <br>
                    <strong>外部评级：</strong><span id="briefevaluateModal_rating"></span>
                    <br>
                    <br>
                    <strong>财务状况：</strong><strong class="pull-right">亿元</strong>
                    <table id="table2" data-toggle="table"
                           data-url="#" data-search="false" data-pagination="false"  >
                        <thead>
                        <tr>
                            <th data-field="a1" data-sortable="true">财报时间</th>
                            <th data-field="a2" data-sortable="true" data-align="right" data-formatter="table2DataFormatter">2018</th>
                            <th data-field="a3" data-sortable="true" data-align="right" data-formatter="table2DataFormatter">2017</th>
                            <th data-field="a4" data-sortable="true" data-align="right" data-formatter="table2DataFormatter">2016</th>
                            <th data-field="a5" data-sortable="true" data-align="right" data-formatter="table2DataFormatter">2015</th>
                        </tr>
                        </thead>
                    </table>
                </div>
                <!-- /.col -->
                <div class="col-sm-5 invoice-col">
                    简评：
                    <address>
                        <strong>外部环境</strong><br>
                        <span id="briefevaluateModal_externalEnvironment"></span>
                    </address>
                    <address>
                        <strong>业务经营</strong><br>
                        <span id="briefevaluateModal_businessOperation"></span>
                    </address>
                    <address>
                        <strong>财务表现</strong><br>
                        <span id="briefevaluateModal_financialPerformance"></span>
                    </address>
                </div>

                <!-- /.col -->
            </div>
            <br>
            <div class="row">
                <div class="col-xs-12 table-responsive">
                    <div id="toolbar">
                        <div class="form-inline " style="text-align: center" role="form">
                            <b>同行业其他企业</b>
                        </div>
                    </div>
                    <table id="table3" data-toggle="table"
                           data-url="#" data-search="false" data-pagination="false"  >
                        <thead>
                        <tr>
                            <th data-field="custName" data-sortable="true">企业名称</th>
                            <th data-field="newScore" data-sortable="true" data-align="right"  data-formatter="table1ScoreFormatter">评分</th>
                            <th data-field="newTotalAsset" data-sortable="true" data-align="right"  data-formatter="table2DataFormatter">总资产规模</th>
                            <th data-field="newRevenue" data-sortable="true" data-align="right"  data-formatter="table2DataFormatter">营业总收入</th>
                            <th data-field="newLiren" data-sortable="true" data-align="right"  data-formatter="table2DataFormatter">净利润</th>
                            <th data-field="newZichanlv" data-sortable="true" data-align="right"  data-formatter="table2DataFormatter">资产负债率</th>
                            <th data-field="newJzchanlv" data-sortable="true" data-align="right" data-formatter="table2DataFormatter">净资产回报率</th>
                            <th data-field="newZonghblv" data-sortable="true" data-align="right"  data-formatter="table2DataFormatter">总资产回报率</th>
                        </tr>
                        </thead>
                    </table>
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </section>
    </div>
</div>
<script>
    function table2DataFormatter(value, row, index) {
        if(value != "" && value != undefined)
            return number_format(value,2,".",",") ;
        return value;
    }
    function table1ScoreFormatter(value, row, index) {
        if(value != "" && value != undefined)
            return number_format(value,0) ;
        return value;
    }
    function briefevaluateModal_init() {
        $("#briefevaluateModal_custName").val("");
        $("#briefevaluateModal_custName").empty();
        $("#briefevaluateModal_custId").val("");
        $("#briefevaluateModal_issuerId").val("");
        $("#briefevaluateModal_industry").val("");
        $("#briefevaluateModal_newScore").html("");
        $("#briefevaluateModal_newFinancialTime").html("");
        $("#briefevaluateModal_externalEnvironment").html("");
        $("#briefevaluateModal_businessOperation").html("");
        $("#briefevaluateModal_financialPerformance").html("");
        $("#briefevaluateModal_largestHold").html("");
        $("#briefevaluateModal_largestHolderName").html("");
        $("#briefevaluateModal_rating").html("");
    }

    function briefevaluateModal_setValue(index) {
        var datas = $("#customerInfoTable").bootstrapTable("getData");
        var data = datas[index];
        $("#briefevaluateModal_custName").val(data.custName);
        $("#briefevaluateModal_custName").html(data.custName);
        $("#briefevaluateModal_custId").val(data.id);
        $("#briefevaluateModal_issuerId").val(data.issuerId);
        $("#briefevaluateModal_industry").val(data.industry);
        $("#briefevaluateModal_newScore").html(number_format(data.newScore,0));
        $("#briefevaluateModal_newFinancialTime").html(data.newFinancialTime.substr(0,4) + "年年度财报");
        $("#briefevaluateModal_externalEnvironment").html(data.externalEnvironment);
        $("#briefevaluateModal_businessOperation").html(data.businessOperation);
        $("#briefevaluateModal_financialPerformance").html(data.financialPerformance);

        $("#briefevaluateModal_largestHold").html(data.largestHold + "%");
        $("#briefevaluateModal_largestHolderName").html(data.largestHolderName);
        $("#briefevaluateModal_rating").html(data.rating);

        $("#table1").bootstrapTable("refresh",{url:"/companyscore/info/custscorelist?issuerId=" +$("#briefevaluateModal_issuerId").val()}) ;
        $("#table2").bootstrapTable("refresh",{url:"/companyscore/info/financialdata?custId="+ $("#briefevaluateModal_custId").val()}) ;
        $("#table3").bootstrapTable("refresh",{url:"/companyscore/info/customerlist?custId="+ $("#briefevaluateModal_custId").val() + "&industry="+$("#briefevaluateModal_industry").val()}) ;
    }


</script>